package maosy.oauth2.password.entities;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.Date;
import java.util.Objects;

@Entity
@Table(name = "tb_user_resource", schema = "hzjw_account")
public class TbUserResourceEntity {
    private String id;
    private String userId;
    private String resourceId;
    private Date createTime;
    private String createManagerId;
    private Date updateTime;
    private String updateManagerId;
    private Boolean isDelete;

    @Basic
    @Id
    @Column(name = "id", nullable = true, length = 32)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Basic
    @Column(name = "user_id", nullable = true, length = 32)
    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "resource_id", nullable = true, length = 32)
    public String getResourceId() {
        return resourceId;
    }

    public void setResourceId(String resourceId) {
        this.resourceId = resourceId;
    }

    @Basic
    @Column(name = "create_time", nullable = true)
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "create_manager_id", nullable = true, length = 32)
    public String getCreateManagerId() {
        return createManagerId;
    }

    public void setCreateManagerId(String createManagerId) {
        this.createManagerId = createManagerId;
    }

    @Basic
    @Column(name = "update_time", nullable = true)
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "update_manager_id", nullable = true, length = 32)
    public String getUpdateManagerId() {
        return updateManagerId;
    }

    public void setUpdateManagerId(String updateManagerId) {
        this.updateManagerId = updateManagerId;
    }

    @Basic
    @Column(name = "is_delete", nullable = true)
    public Boolean getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Boolean isDelete) {
        this.isDelete = isDelete;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbUserResourceEntity that = (TbUserResourceEntity) o;
        return Objects.equals(id, that.id) &&
                Objects.equals(userId, that.userId) &&
                Objects.equals(resourceId, that.resourceId) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(createManagerId, that.createManagerId) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(updateManagerId, that.updateManagerId) &&
                Objects.equals(isDelete, that.isDelete);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, resourceId, createTime, createManagerId, updateTime, updateManagerId, isDelete);
    }
}
